import { ref } from 'vue'
import { defineStore } from 'pinia'
interface userInfo {
 money?:number,
 phone?:string
}
export const userStore = defineStore('userInfo', () => {
  const userInfo = ref<userInfo>({
  })
  
  const setInfo = (val: object) => {
    userInfo.value = val
  }


  const resetInfo = () => {
   userInfo.value = {}
  }

  return { userInfo, setInfo, resetInfo }
}, {
  persist: true
})